package com.guoqing.redis;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author guoqi
 */
@SpringBootApplication
@Slf4j
public class BootRedisApplication {

    public static void main(String[] args) throws UnknownHostException {
        Environment env = SpringApplication.run(BootRedisApplication.class, args).getEnvironment();
        log.info("\n-----------------------------------------------------------------\n" +
                        "       Application '{}' is running!  \n" +
                        "       Access URLS: \n" +
                        "           localhost:  http://localhost:{} \n" +
                        "           localIp:    http://{}:{} \n" +
                        "           SwaggerUI:  http://localhost:{}/swagger-ui.html \n" +
                        "-----------------------------------------------------------------",
                env.getProperty("spring.application.name"),
                env.getProperty("server.port"),
                InetAddress.getLocalHost().getHostAddress(), env.getProperty("server.port"),
                env.getProperty("server.port")
        );

        //"SimpleJob","0/5 * * * * ?",10,SimpleJob.class, JobType.SIMPLE
        /*JobConfig a = new JobConfig();
        a.zhang("myjob1","0/5 * * * * ?",10, MyJob.class, JobType.SIMPLE);
        a.zhang("myjob2","0/5 * * * * ?",10, MyJob.class, JobType.SIMPLE);*/
        System.out.println("启动完毕----");
    }

}
